import request from '@/utils/request'

// 视导页面: 根据个人id查找最近的视导记录
export function getNewestComment() {
	return request({
		'url': '/phoneWork/getNewestComment',
		'method': 'post'
	})
}

// 视导记录查看: 根据活动的Id还有学校的id查找一级和二级指标
export function getTargetsBySchoolIdAndActivityIDExcludeThirdLevel(activityId, schoolId, createTime) {
	return request({
		'url': '/phoneWork/getTargetsBySchoolIdAndActivityIDExcludeThirdLevel',
		'method': 'post',
		'params': {
			activityId,
			schoolId,
			createTime
		}
	})
}


// 视导页面: 右上角消息
export function myMessage(pageIndex) {
	return request({
		url: '/member/myMessage',
		method: 'post',
		params: {
			pageIndex
		}
	})
}

//修改消息阅读状态
export function updateMessage(msgId) {
	return request({
		url: '/member/updateMessage',
		method: 'post',
		params: {
			msgId
		}
	})
}

//根据指标的id获得指标的详细内容
export function getTargetDetail(params) {
	return request({
		url: '/phoneWork/getTargetDetail',
		method: 'post',
		params: params
	})
}

//根据用户的id获取所有的活动列表
export function getActivityList() {
	return request({
		url: '/phoneWork/getActivityList',
		method: 'post'
	})
}

//根据活动的id获得活动对应的区域信息
export function getAreasByActivityId(activityId) {
	return request({
		url: '/phoneWork/getAreasByActivityId',
		method: 'post',
		params: {
			activityId
		}

	})
}

// 根据区域的code值查找活动对应的学校
export function findSchoolsByAreaCode(params) {
	return request({
		url: '/phoneWork/findSchoolsByAreaCode',
		method: 'post',
		params: params

	})
}

// 获取某个学校的问题指标
export function getProblemTargets(schoolId) {
	return request({
		url: '/phoneWork/getProblemTargets',
		method: 'post',
		params: {
			schoolId
		}

	})
}
import config from "@/config.js"
export const uploadUrl = config.baseUrl + "/upload/uploadPic";


// 保存视导记录
export function saveComments(comments) {
	return request({
		url: '/phoneWork/saveComments',
		method: 'post',
		params: {
			comments
		}

	})
}

// 根据学校id，活动id修改当前用户评价的提交状态
export function submitComment(activityId, schoolId, commentId) {
	return request({
		url: '/phoneWork/submitComment',
		method: 'post',
		params: {
			activityId,
			schoolId,
			commentId
		}

	})
}




//校园巡视详情列表
export function siteSupervisionList(startDate, endDate) {
	return request({
		url: '/super/siteSupervisionList',
		method: 'post',
		params: {
			startDate,
			endDate
		}

	})
}

//获取未提交视导数量
export function uncommitted() {
	return request({
		url: '/member/uncommitted',
		method: 'post'

	})
}

//小组视导记录列表
export function groupSupervisionList(startDate, endDate) {
	return request({
		url: '/super/groupSupervisionList',
		method: 'post',
		params: {
			startDate,
			endDate
		}

	})
}

//我的小组列表
export function myGroupList(activityId) {
	return request({
		url: '/super/myGroupList',
		method: 'post',
		params: {
			activityId
		}

	})
}

//小组已评价学校列表
export function groupSchoolList(groupId) {
	return request({
		url: '/super/groupSchoolList',
		method: 'post',
		params: {
			groupId
		}

	})
}

//查询小组指标详情
export function groupCommentList(params) {
	return request({
		url: '/super/groupCommentList',
		method: 'post',
		params: params
	})
}


//组长修改保存
export function savegroupLeaderUpdate(comments) {
	return request({
		url: '/super/savegroupLeaderUpdate',
		method: 'post',
		params: {
			comments
		}
	})
}

//根据小组的id查找所有的记录
export function getChartDateByGroupId(activityId, groupId) {
	return request({
		url: '/phoneWork/getChartDateByGroupId',
		method: 'post',
		params: {
			activityId,
			groupId
		}

	})
}

//根据区域的code以及小组的id查找所有的学校以及学校的指标完成情况
export function getSchoolTargetCountByAreaCodeAndGroupId(activityId, groupId, areaCode) {
	return request({
		url: '/phoneWork/getSchoolTargetCountByAreaCodeAndGroupId',
		method: 'post',
		params: {
			activityId,
			groupId,
			areaCode
		}

	})
}